package com.music.service.impl;

import com.music.common.BaseResult;
import com.music.dao.CmMyHomePageMapper;
import com.music.entity.CmUser;
import com.music.service.CmMyHomePageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CmMyHomePageServiceImpl implements CmMyHomePageService {

    @Autowired
    private  CmMyHomePageMapper cmMyHomePageMapper;

    @Override
    public BaseResult MyHomePagefindAll(){
        BaseResult baseResult = new BaseResult();
        List<CmUser> cmUsers = cmMyHomePageMapper.MyHomePagefindAll();
        if(cmUsers!=null){
            baseResult.setData(cmUsers);
            baseResult.setCode(200);
            baseResult.setMessage("查询成功");
            return baseResult;
        }
        baseResult.setCode(201);
        baseResult.setMessage("查询失败");
        return baseResult;
    }
}
